/*
 *  rvMath.h
 *  ReVerb
 *
 *  Created by Brandon Braley on 8/21/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */
#ifndef		__RVMATH_H__
#define		__RVMATH_H__

namespace ReVerb
{
	struct Vec2D
	{
		/**
		*	Data
		*/
		float	x, y;

		/**
		*	Constructors
		*/
		Vec2D()	:
			x(0.0f), y(0.0f)
		{
		}
		Vec2D(float x, float y)	:
			x(x), y(y)
		{
		}
		Vec2D( const Vec2D& ref)	:
			x(ref.x), y(ref.y)
		{
		}

		/**
		*	Destructor
		*/
		~Vec2D()		{}

		/**
		*	Mathematical operator overloads
		*/
		Vec2D	operator*	( const Vec2D& rhs )
		{
			return Vec2D( x * rhs.x,
						  y * rhs.y );
		}

		Vec2D operator/		( const Vec2D& rhs )
		{
			return Vec2D( x * rhs.x,
						  y * rhs.y );
		}

		Vec2D operator+		( const Vec2D& rhs )
		{
			return Vec2D( x + rhs.x,
						  y + rhs.y );
		}

		Vec2D operator-		( const Vec2D& rhs )
		{
			return Vec2D( x - rhs.x,
						  y - rhs.y );
		}

		/**
		 *	Assignment operator overloads
		 */
		Vec2D& operator=( const Vec2D& ref )
		{
			x = ref.x;
			y = ref.y;
			return *this;
		}

		Vec2D& operator*=( const Vec2D& ref )
		{
			x *= ref.x;
			y *= ref.y;
			return *this;
		}

		Vec2D& operator/=( const Vec2D& ref )
		{
			x /= ref.x;
			y /= ref.y;
			return *this;
		}

		Vec2D& operator+=( const Vec2D& ref )
		{
			x += ref.x;
			y += ref.y;
			return *this;
		}

		Vec2D& operator-=( const Vec2D& ref )
		{
			x -= ref.x;
			y -= ref.y;
			return *this;
		}

		/**
		 *	Logical operator overloads
		 */
		bool operator==		( const Vec2D& rhs )
		{
			return (x == rhs.x) & (y == rhs.y);
		}
	};
};

#endif		//__RVMATH_H__